home *** CD-ROM | disk | FTP | other *** search
- Path: news.informatik.uni-muenchen.de!usenet
- From: Kurt Watzka <watzka@stat.uni-muenchen.de>
- Newsgroups: comp.lang.c
- Subject: Re: New (but motivated) C user looking for help . . .
- Date: Wed, 28 Feb 1996 15:53:29 +0100
- Organization: Institut fⁿr Statistik
- Message-ID: <31346C69.2BB2@stat.uni-muenchen.de>
- NNTP-Posting-Host: pc7.stat.uni-muenchen.de
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (WinNT; I)
- CC: sconnors@teleport.com
-
- Steve wrote:
- >
- > Hello,
- >
- > I'm trying to write a program that will gather an
- > ip address, and a subnet mask typed in at the
- > keyboard, and do a bitwise AND to view the result.
- >
- > First I thought I could bring the dotted octet in
- > as an integer, but quickly found that I could not.
- >
-
- Try reading _four_ unsigned integers and combining them
- with bitwise shifts. As in most cases, sscanf() will be
- your friend. "%u.%u.%u.%u" is probably not the worst
- possible format string for your problem.
-
- Kurt
-